package com.tcl.aota.admin.dto;

import org.apache.commons.lang.StringUtils;

import java.util.HashMap;
import java.util.Map;

/**
 * 动态统计查询json参数body类
 *
 * @author kelong
 * @date 1/21/15
 */
public class DnStaParamDTO {
    private String startTime;
    private String endTime;
    private String appName;
    private Integer type;//1按 TOTAL,2 按 IMEI

    public String getStartTime() {
        return startTime;
    }

    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }

    public String getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }

    public String getAppName() {
        return appName;
    }

    public void setAppName(String appName) {
        this.appName = appName;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Map<String, Object> toMap() {
        Map<String, Object> conditions = new HashMap<>();
        if (!StringUtils.isEmpty(startTime)) {
            conditions.put("startTime", startTime);
        }
        if (!StringUtils.isEmpty(endTime)) {
            conditions.put("endTime", endTime);
        }
        if (!StringUtils.isEmpty(appName)) {
            conditions.put("appName", appName);
        }
        return conditions;
    }
}
